const path = require('path')
module.exports = {

  publicPath: "./",
  css: {
    loaderOptions: {
      postcss: {
        plugins: [
          require('postcss-pxtorem')({ // 把px单位换算成rem单位
            rootValue: 37.5, // 换算的基数(设计图750的根字体为32)
            // selectorBlackList: ['weui', 'mu'], // 忽略转换正则匹配项
            propList: ['*']
          })
        ]
      }
    }
  },
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: [path.resolve(__dirname, "src/common/less/variable.less")] // 引入全局样式变量
    }
  },
  devServer: {
    port: 1890,
    proxy: {
      '/api': {
        //本地服务接口地址
        target: 'http://saber.aged.aijk.net/api', // 测试环境
        ws: true,
        pathRewrite: {
          '^/api': '/'
        }
      }
    }
  }
};
